package cn.tedu.property_management_system.mapper;

import cn.tedu.property_management_system.entity.Complaint;
import cn.tedu.property_management_system.entity.ComplaintExample;

import cn.tedu.property_management_system.entity.DTO.ComplaintAddNewDTO;
import cn.tedu.property_management_system.entity.VO.ComplaintVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface ComplaintMapper {
    int countByExample(ComplaintExample example);

    int deleteByExample(ComplaintExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Complaint record);

    int insertSelective(Complaint record);

    List<Complaint> selectByExample(ComplaintExample example);

    Complaint selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Complaint record, @Param("example") ComplaintExample example);

    int updateByExample(@Param("record") Complaint record, @Param("example") ComplaintExample example);

    int updateByPrimaryKeySelective(Complaint record);

    int updateByPrimaryKey(Complaint record);

    /**
     * 进入页面时加载所有投诉信息值对象
     */
    List<ComplaintVO> selectAllToComplaintVO();

    /**
     * 查询个人投诉信息
     * @return 值传递对象
     */
    List<ComplaintVO> selectAllToComplaintVOPersonal(@Param("username") String username);

    /**
     * 查询所有投诉
     */
    List<Complaint> selectAllComplaint();

    /**
     * 筛选按查询
     */
    List<ComplaintVO> selectAllToComplaintVOByStatusAndComId
            (@Param("com_id") Integer com_id,@Param("status") Integer status);

    /**
     * 批量删除
     */
    int deleteByIds(Integer[] ids);

    /**
     * 更新投诉状态
     */
    int updateStatues(Complaint complaint);

    /**
     * 用户添加投诉信息
     */
    int insertComplaint(Complaint complaint);
}